package com.haibara.codesubmiteval.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.haibara.codesubmiteval.model.entity.QuestionSubmit;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@Data
public class QuestionSubmitVO implements Serializable {
    private Long questionId;
    /**
     * 题目标签
     */
    private String questionTitle;

    /**
     * 时间消耗
     */
    private Integer timeUsed;

    /**
     * 空间消耗
     */
    private Integer memoryUsed;

    /**
     * 判题结果
     */
    private String judgeResult;

    /**
     * 提交用户信息
     */
    private Long userId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Serial
    private static final long serialVersionUID = 1L;

    public static QuestionSubmitVO getQuestionSubmitVOByQuestionSubmit(QuestionSubmit questionSubmit) {
        QuestionSubmitVO questionSubmitVO = new QuestionSubmitVO();
        BeanUtil.copyProperties(questionSubmit, questionSubmitVO);
        return questionSubmitVO;
    }

}
